#pragma once
#include "FlyComponent.h"
#include <memory>
#include <map>

//单例模式:静态类;
class FlyFactoryStatic
{
private:
    //私有化构造函数, 方式外部new;
    FlyFactoryStatic();
    ~FlyFactoryStatic();

    //禁用拷贝构造和赋值重载
    FlyFactoryStatic(const FlyFactoryStatic& hs) = delete;
    FlyFactoryStatic& operator=(const FlyFactoryStatic& hs) = delete;
public:

    //获取单例;
    static FlyFactoryStatic* GetInstance();

    /// <summary>
    /// 获取一个FlyCom;
    /// </summary>
    std::shared_ptr<FlyComponent> GetFlyCom(QString strName);

    /// <summary>
    /// 打印对象;
    /// </summary>
    void Display();

private:

    std::map<QString, std::shared_ptr<FlyComponent>> m_mapFly;
};

